package com.naiterui.ehp.bs.cms.modules.oms.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.naiterui.common.repository.annotation.Query;
import com.naiterui.common.repository.annotation.Query.Type;
import com.naiterui.common.repository.annotation.QueryCriteria;
import com.naiterui.ehp.bp.support.bean.annotation.Fen2Yuan;
import com.naiterui.ehp.bs.cms.common.json.Dict;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;
import java.util.List;

@Data
public class OrderVO implements QueryCriteria {

    private static final long serialVersionUID = 1965125238050057446L;

    @ApiModelProperty(value = "订单ID")
    private Long id;
    /**
     * 订单号
     */
    @Query(propName = "t.order_sn", type = Type.EQUAL)
    @ApiModelProperty(value = "订单ID")
    private String orderSn;

    @Query(propName = "u.phone", type = Type.EQUAL)
    @ApiModelProperty(value = "手机号")
    private String phone;

    /**
     * 快递公司
     */
    @ApiModelProperty(value = "物流公司")
    private String logisticsCompany;
    /**
     * 物流单号
     */
    @ApiModelProperty(value = "物流单号")
    private String deliveryId;
    /**
     * 下单用户id
     */
    @Query(propName = "t.user_id", type = Type.EQUAL)
    @ApiModelProperty(value = "下单用户id")
    private Long userId;
    /**
     * 用户名称
     */
    @ApiModelProperty(value = "用户名称")
    private String userName;
    /**
     * 用户昵称
     */
    @ApiModelProperty(value = "用户昵称")
    private String nickName;
    /**
     * 仓库ID
     */
    @ApiModelProperty(value = "仓库ID")
    private Long warehouseId;

    /**
     * 订单状态(1:待付款,2:处方流转成功,3:订单已发货,4:订单已签收,5:已取消,6:处方流转失败)
     */
    @Query(propName = "t.order_status", type = Type.EQUAL)
    @ApiModelProperty(value = "订单状态")
    @Dict(type = "order_status")
    private Integer orderStatus;

    /**
     * 支付状态(0:未支付,1:已支付,2:退款)
     */
    @ApiModelProperty(value = "支付状态(0:未支付,1:已支付,2:退款)")
    @Dict(type = "pay_order_status")
    private Integer payStatus;
    /**
     * 支付类型(1:货到付款,2:微信支付)
     */
    @Dict(type = "pay_type")
    @ApiModelProperty(value = "支付类型(1:微信支付,2:货到付款) 描述使用 payTypeDescribe")
    private Integer payType;

    @Query(propName = "dmr.serial_number", type = Type.EQUAL)
    @Dict(type = "serial_number")
    @ApiModelProperty(value = "处方单编码")
    private String serialNumber;
    /**
     * 渠道号
     */
    @ApiModelProperty(value = "渠道号")
    private String channelTradeSn;
    /**
     * 取消原因(0:未取消,1:未支付取消,2:支付后取消3:确认后取消,4:测试订单)
     */
    @ApiModelProperty(value = "取消原因")
    private Integer cancelReason;
    /**
     * 商品总价(分)
     */
    @Fen2Yuan
    @ApiModelProperty(value = "商品总价")
    private Integer totalAmount;
    /**
     * 实付(分)
     */
    @Fen2Yuan
    @ApiModelProperty(value = "实付")
    private Integer realPay;
    /**
     * 邮费(分)
     */
    @Fen2Yuan
    @ApiModelProperty(value = "邮费")
    private Integer freight;
    /**
     * 优惠券抵扣(分)
     */
    @Fen2Yuan
    @ApiModelProperty(value = "优惠券抵扣")
    private Integer couponPay;
    /**
     * 是否需要发票(0:不需要,1:需要)
     */
    @ApiModelProperty(value = "是否需要发票(0:不需要,1:需要)")
    private Integer needInvoice;
    /**
     * 发票抬头
     */
    @ApiModelProperty(value = "发票抬头")
    private String invoiceTitle;
    /**
     * 发票明细
     */
    @ApiModelProperty(value = "发票明细")
    private String invoiceContent;
    /**
     * 发票邮箱
     */
    @ApiModelProperty(value = "发票邮箱")
    private String invoiceEmail;
    /**
     * 发票电话
     */
    @ApiModelProperty(value = "发票电话")
    private String invoicePhone;
    /**
     * 发票税号
     */
    @ApiModelProperty(value = "发票税号")
    private String invoiceTaxNo;
    /**
     * 拣货人
     */
    @ApiModelProperty(value = "拣货人")
    private String pickupMan;
    /**
     * 发货时间
     */
    @ApiModelProperty(value = "发货时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date sendTime;
    /**
     * 支付时间
     */
    @ApiModelProperty(value = "支付时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date payTime;

    /**
     * 订单备注
     */
    @ApiModelProperty(value = "订单备注")
    private String remark;

    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createdAt;

    @ApiModelProperty(value = "创建人")
    private String createdBy;

    @ApiModelProperty(value = "修改时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date changedAt;

    @ApiModelProperty(value = "订单ID")
    private String changedBy;

    /**
     * 收货地址信息
     */
    @ApiModelProperty(value = "收货地址信息")
    private OrderUserVO orderUser;

    /**
     * 商品信息
     */
    @ApiModelProperty(value = "商品信息")
    private List<OrderItemVO> orderItems;

    @ApiModelProperty(value = "订单操作日志")
    private List<OrderLogVO> logs;

    @ApiModelProperty(value = "处方ID")
    private Long recomId;

    @ApiModelProperty(value = "处方地址")
    private String prescriptionPhotoUrl;

}

